<?php

require_once('../lib/config.php');
require_once('../lib/JSON.php');

$id = (int)$_GET['id'];

$user = new $whatsit_user_class();
$db = new $whatsit_database_class($user->getUserName());

$whatsit = $db->getWhatsit($id);

$pref_array = $whatsit->getPreferenceArray();

$json = new Services_JSON();
$json_prefs = $json->encode($pref_array);
?>
<html>
<head>
<title><?= $whatsit->getTitle() ?></title>
<script type="text/javascript">
var module_id = <?= $whatsit->getID() ?>;
var initial_prefs = <?= $json_prefs ?>;
</script>
<script src="../javascript/lib.js"></script>
</head>
<body onload="whatsits_onloads();">
<div id="content-<?= $whatsit->getID() ?>" style="border:0;padding:0;margin:0;width:100%;height:auto;overflow:hidden;">
<?php $whatsit->drawContent(); ?>
</div>
</body>
</html>